﻿using System.Data;

namespace _10_C_中的隐式转换和显式转换
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.Title = "C#中的隐式转换和显示转换";

            //int a = 1;
            //long b = 2;

            //a = (int)b;//显式转换
            //b = a
            //=---------------------

            //int a = 1;
            //double b = 2.123;

            //a = (int)b;
            //b = a;


            //Console.WriteLine(b);


            //string str = "aaa";
            //object obj = new object();
            //str = (string)obj;
            //obj = str;

            //implicit和explicit //隐式和显示
            MyInt my = new MyInt(1);

            double dbe = 2.0;

            my = (MyInt)dbe;

            dbe = my;

            Console.ReadKey();
        }
    }
}
